<template>
	<view class="sel_wrap" v-if="flag" @click.self="toClose">
		<view class="sel_bot">
			<view>选择成员</view>
			<view class="pian_wrap">
				<image src="../../static/gift.png"></image>
				<view v-if="nowPain.name">{{nowPain.name}}</view>
				<navigator url="/pages/addperson/list" >重新选择</navigator>
			</view>
			<view><button type="primary" @click.stop="toPhy">提交预约</button></view>
		</view>
	</view>
</template>

<script setup>
	import {defineProps,defineEmits,computed} from 'vue'
	import {painStore} from '@/store/painer.js'
	let nowPain=computed(()=>painStore().painer)
	
	let props=defineProps({
			flag:{
				type:Boolean,
				default:false
			}
	});
	// 点击遮罩层 关闭组件
	let emits=defineEmits(["sendFlag","sendPhy"])
	let toClose=()=>{
		emits("sendFlag",false)
	}
	// 子传父
	let toPhy=()=>{
		// 发送就诊人id给父组件
	
		emits("sendPhy",nowPain.value._id)
	}
</script>

<style scope lang="scss">
	.sel_wrap{
		position: fixed;
		top:0;
		left:0;
		width:100vw;
		height: 100vh;
		background: rgba(0,0,0,0.5);
		z-index:998;
		.sel_bot{
			width: 100vw;
			height: 400rpx;
			position: absolute;
			bottom:0;
			left: 0;
			z-index:999;
			background: white;
			display: flex;
			flex-direction: column;
			justify-content: space-around;
			.pian_wrap{
				display: flex;
				justify-content: space-around;
				align-items: center;
				height: 180rpx;
				image{
					width:140rpx;
					height: 140rpx;
				}
			}
		}
	}
</style>